package com.itwill.ecom.receiver;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("receiverDao")
public class ReceiverDaoImpl implements ReceiverDao{
	private static String namespace = "com.itwill.ecom.receiver.ReceiverMapper";
	@Autowired
	private SqlSession session;
	
	public SqlSession getSession(){
		return session;
	}
	
	public void setSession(SqlSession session){
		this.session = session;
	}
	
	public ReceiverDaoImpl(){
		System.out.println("#### ReceiverDao() : 디폴트생성자 호출  ");
	}
	
	@Override
	public int create(ReceiverBeans receiver) {
		return session.insert(namespace + ".create", receiver);
	}

	@Override
	public ReceiverBeans readReceiver(int o_no) {
		return session.selectOne(namespace + ".readReceiver", o_no);
	}

	@Override
	public int delete(int o_no) {
		return session.delete(namespace + ".delete", o_no);
	}

}
